<template>
  <div>
    <div class="butt">
      <el-button @click="Switch" type="text">	&lt;&lt;点击返回</el-button>
    </div>

    <div class="box">
      <h4>{{ title }}</h4>
      <div class="Author">
        <p>作者：{{ names }}</p>
        <p>|</p>
        <p>发表时间：{{ date | formatTimer }}</p>
      </div>
      <div v-html="ss"></div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ss: "",
      title: "",
      item: 0,
      date: "",
      names: "",
      id: 0,
    };
  },
  methods: {
    getdata() {
      // 公告详情
      this.id = localStorage.getItem("tex_02");
      // 公告详情
      this.$http
        .get("/notice/detail", {
          id: this.id,
        })
        .then((res) => {
          // console.log(res.data);
          this.item=localStorage.getItem("tex");
          this.ss = res.data[0].content;
          // console.log(res.data[0]);
          this.title = res.data[0].title;
          this.date = res.data[0].createTime;
          this.names = res.data[0].author;
        });
    },
    Switch() {
      this.$router.go(-1)
    },
  },

  mounted() {
    this.getdata();
   
  },
};
</script>

<style lang="less" scoped>
.butt {
  position: fixed;
  top: 20px;
  left: 120px;
}
.box {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  width: 800px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
}
h4 {
  text-align: center;
  margin-bottom: 15px;
}
.Author {
  overflow: hidden;
  margin: 0 auto;
  padding-bottom: 15px;
}
.Author p {
  float: left;
  color: #666a6d;
  margin-left: 5px;
  font-size: 13px;
}
</style>